﻿using System;

namespace RexToy.UI.Controls
{
    public class Content : Control
    {
        private string __text;
        public string Text
        {
            get { return __text; }
            set
            {
                this.__text = value;
                this.__domNode._element.InnerHTML = value;
            }
        }

        public Content(string text, Tag? tag)
        {
            this.__text = text;
            this.__domNode = RexToy.UI.Controls.DomNode.Create(new DomNodeCreateOptions()
            {
                tag = tag ?? Tag.P,
                innerHTML = this.__text
            });
        }
    }
}
